import logging, yagmail
import HTMLTestRunner_PY3


class Tools():
    def Mail(self):
        mail=yagmail.SMTP(user='2109784600@qq.com',password='cibsycprakdndbdj',host='smtp.qq.com')
        mail.send(to='2109784600@qq.com',subject='维度系列测试产出物',
                  contents=['描述','wms_unit.log','WMS_unit.html','../pytest/test.log'])
        mail.close()
    def log1(self):
        log = logging.basicConfig(level=logging.DEBUG,
                                  format='%(levelname)s %(asctime)s %(message)s %(filename)s %(lineno)d',
                                  filename='wms_unit.log',
                                  filemode='w+')

        return log

    def report(self):
        report=HTMLTestRunner_PY3.HTMLTestRunner(open('WMS_unit.html','wb'),
                                                 title='仓储管理业务',
                                                 description="仓储管理业务，涉及业务5条")
        return report
